import React, {Component} from 'react'
import web3 from './util/web3utils';
import TabExampleBasic from './ui/centerTab'

class App extends Component {
    constructor(props) {
        super(props);
        this.state = {
            currentAccount:'',
        };
    }

// 组件初始化时自动执行的方法
    async componentDidMount() {
        let accounts = await web3.eth.getAccounts();
        console.log(accounts[0]);
        this.setState({
            currentAccount: accounts[0],
        });


    }

    render() {
        return (
            <div className="App">
                {this.state.currentAccount}
                <TabExampleBasic/>
            </div>
        );
    }
}

export default App;
